package test19.properties_;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Properties01 {
    public static void main(String[] args) throws IOException {
        //读取mysql.properties 文件，并得到ip, user 和 pwd
        String filePath = "src\\test19\\properties_\\mysql.properties";
        String data = "";
        BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath));
        while ((data = bufferedReader.readLine()) != null){
            String[] split = data.split("=");
            //如果输出ip
            if ("ip".equals(split[0])){
                System.out.println(split[0]+"值是："+split[1]);
            }
        }
        bufferedReader.close();
    }
}
